import java.util.HashMap;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str1 = scan.nextLine();
        String str2 = scan.nextLine();
        HashMap<Character,Integer> hashMap = new HashMap<>();
        for (int i = 0; i < str2.length(); i++) {
            if(hashMap.get(str2.charAt(i)) == null){
                hashMap.put(str2.charAt(i),1);
            }else {
                hashMap.put(str2.charAt(i),hashMap.get(str2.charAt(i)+1));
            }
        }
        System.out.println(1111);
        String sumStr = "";
        for (int i = 0; i < str1.length(); i++) {
            if(hashMap.get(str1.charAt(i)) == null){
                sumStr += str1.charAt(i);
            }
        }
        System.out.println(sumStr);
    }
}